package com.blank.shop.hystrix.consumer;

import com.blank.shop.hystrix.ShopHystrixApplication;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * <br/>Date 2021/8/31
 * <br/>Time 14:03:25
 *
 * @author _blank
 */
@FeignClient(name = ShopHystrixApplication.SERVER_PROVIDER_NAME, fallback = HystrixConsumerFallbackServiceImpl.class)
@Profile({ShopHystrixApplication.SERVER_CONSUMER})
public interface HystrixConsumerService {

    /**
     * 模拟正常请求
     *
     * @return org.springframework.http.ResponseEntity
     */
    @PostMapping(path = {"simulation-normal"})
    ResponseEntity<String> simulationNormal();

    /**
     * 模拟超时请求
     *
     * @return org.springframework.http.ResponseEntity
     */
    @PostMapping(path = {"simulation-time-out"})
    ResponseEntity<String> simulationTimeOut();

}
